package com.authine.cloudpivot.ext.enums.order.transfer;

public enum PurchaseInvoiceEnum {


    /**
     * 采购发票状态
     */

    ALL(0, "全部"),
    NEW(1, "新建"),
    RECEIVED(2, "待收票"),
    DISMISSED(3, "已驳回"),
    CONFIRM(4, "财务确认"),
    CANCEL(5, "订单组已退票"),
    ABANDON(6, "作废"),
    PARTIAL(7, "部分收票"),
    SENT(8,"财务组已收票"),
    OrderReceived(9,"订单组已收票"),
    FinanceDismissed(10, "财务组已退票"),
    Close(11,"已关闭");




    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    private PurchaseInvoiceEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static PurchaseInvoiceEnum get(Integer code) {

        for (PurchaseInvoiceEnum c : PurchaseInvoiceEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }

}
